package com.lry.basic.lambda;

import org.springframework.beans.factory.ObjectFactory;
import org.springframework.util.Assert;

/**
 * @author:刘仁有
 * @desc:
 * @email:953506233@qq.com
 * @data:2019/12/2
 */
public class Lambda {

    public static void main(String[] args) {
        addSingletonFactory(() -> getEarlyBeanReference());
    }

    private static Object getEarlyBeanReference() {
        System.out.println(2);
        return 1;
    }

    public static void addSingletonFactory(ObjectFactory<?> singletonFactory) {
        System.out.println(singletonFactory.getObject());
    }

}
